<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>业务员管理 - 销售业绩管理系统</title>
<style type="text/css">
<!--
.STYLE1 {	color: #FFFFFF;
	font-weight: bold;
	font-size: 12px;
}
.STYLE6 {font-size: 12px; }
.STYLE7 {font-size: 12px; background-color: #f5f5f5;margin:0;}
.STYLE9 {font-size: 12px; background-color: #ffffff;margin:0;}
.STYLE8 {color: #FFFFFF;font-weight: bold;font-size: 12px; background-color: #1C94C4;margin:0; }
body { 
margin:0;
}
a:link {
	color: #0066FF;
	text-decoration: none;
}
a:visited {
	text-decoration: none;
	color: #0099FF;
}
a:hover {
	text-decoration: none;
}
a:active {
	text-decoration: none;
}
-->
</style>
</head>
<link href="../components/mmGrid/mmGrid.css" rel="stylesheet"
	type="text/css" media="all" />
<link href="../components/mmGrid/mmPaginator.css" rel="stylesheet"
	type="text/css" media="all" />
<script type="text/javascript" src="../js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../components/mmGrid/mmGrid.js"></script>
<script type="text/javascript" src="../components/mmGrid/mmPaginator.js"></script>
<script LANGUAGE="javascript"> 
function showView(id){
window.open('ResultFinalView.html?id=' + id,'_blank','width=1000,height=800,left=200,top=150,resizable=1,status=1'); 
}
</script>

<body margin=0>

<table width="100%" bgcolor="#FFFFFF"  border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="24" class="STYLE7">
      <table width="100%" border="0" cellspacing="2">
        <tr>
          <td height="25" class="STYLE7">业绩管理 &gt;业绩结算</td>
        </tr>
        <tr>
          <td class="STYLE9">结算日期：
            <input name="textfield2" type="text" size="10" />
&nbsp;结算人：
<input name="textfield22" type="text" size="15" />
<input type="submit" name="Submit3" value="查询" />
&nbsp;&nbsp;
<input type="button" name="Submit" value="创建结算" onclick="sumallywy()"/>
</td>
        </tr>
      </table>     </td>
  </tr>
</table>
<table id="userTable"  style="font-size:12px !important;">
			<tr >
				<th rowspan="" colspan=""></th>
			</tr>
	</table>
	<div id="userpg" style="text-align:right;margin-right:10px;font-size:12px;"></div>
</body>
</html>
<script>

var userCol = [
               {title:'结算日期',align: 'center', name:'FinalDate',width:140},
              	{title:'操作人',align: 'center', name:'WorkUser',width:100},
					{title:'结算说明',align: 'center', name:'userrole',width:100},
					
					{title:'操作',name:'',align:'center',lockWidth:true,lockDisplay: true,renderer: function(val){
                     return '<button type="button" class="info">详细</button>';
                 }
					}
           ];
	var userGrid = $('#userTable').mmGrid({
     height: 300
		,width:'99%'
		,indexCol: true
     , cols: userCol
     , url: '../verification/all'
     , method: 'get'
     , root: 'data'
     , multiSelect: false
     , checkCol: false
     , fullWidthRows: true
     , nowrap: true
     , plugins: [
         $('#userpg').mmPaginator({limitList: [10, 20, 30,50]})
     ]
 });

	userGrid.on('cellSelected', function(e, item, rowIndex, colIndex){
     if($(e.target).is('.info')){
         e.stopPropagation();
         showView(item.ID);
     }
 });
	
	function sumallywy(){
		$.get("../verification/sum",{},function(json){
			if(json)
				{
				alert("结算完成！");
				userGrid.load();
				}else
					{
						if (confirm("登录时间过长时间没有做操作，系统已经自动登出您的用户，请重新登陆。")){
							parent.location = "../index.html";
						}
					}
		});
		
	}
	
</script>